package com.sky.mapper;

import com.sky.autofill.AutoFill;
import com.sky.entity.AddressBook;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AddressMapper {
    List<AddressBook> selectAddress();

    @AutoFill(OperationType.INSERT)
    void addAddress(AddressBook addressBook);

    AddressBook selectDefaultAddress();

    @AutoFill(OperationType.UPDATE)
    void updateAddress(AddressBook addressBook);

    @AutoFill(OperationType.INSERT)
    AddressBook selectAddressById(String id);

    void updateDefault(int i,Long userId);

    void deleteAddressById(String id);

    AddressBook getAddressById(Long id, Long userId);
}
